package com.dimong.loan.sdk.ui;

import android.os.Handler;
import android.os.Message;

import com.dimong.loan.sdk.ui.act.BaseFragmentActivity;
import com.zhy.http.okhttp.OkHttpUtils;

import java.lang.ref.WeakReference;

/**
 * Created by wuligang on 2018/3/28.
 */

public class WeakHandler extends Handler {
    private WeakReference<BaseFragmentActivity> mOuter;

    public WeakHandler(BaseFragmentActivity activity) {
        mOuter = new WeakReference<>(activity);
    }

    @Override
    public void handleMessage(Message msg) {
        super.handleMessage(msg);
        BaseFragmentActivity outer = mOuter.get();
        if (outer != null) {
            outer.handleActivityMessage(msg);
        }
    }
}
